package yagwl.client.model;

import java.io.Serializable;
import java.util.List;

@SuppressWarnings("serial")
public class FilterDTO implements Serializable {
  private FilterType filterType;
  private String id;
  private String label;
  
  // for single select and multi select
  private List<ItemDTO> selectList;
  
  // for integer range
  private int minValue;
  private int maxValue;
  private int stepSize;

  public enum FilterType {
    MultiSelect, IntegerRange, SingleSelect
  }

  public void setMultiSelectList(List<ItemDTO> selectList) {
    filterType = FilterType.MultiSelect;
    this.selectList = selectList;
  }

  public void setSingleSelectList(List<ItemDTO> selectList) {
    filterType = FilterType.SingleSelect;
    this.selectList = selectList;
  }

  public List<ItemDTO> getSelectList() {
    return selectList;
  }

  public void setIntegerRange(int minValue, int maxValue, int stepSize) {
    filterType = FilterType.IntegerRange;
    this.minValue = minValue;
    this.maxValue = maxValue;
    this.stepSize = stepSize;
  }

  public int getMinValue() {
    return minValue;
  }

  public int getMaxValue() {
    return maxValue;
  }

  public int getStepSize() {
    return stepSize;
  }

  public FilterType getFilterType() {
    return filterType;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getId() {
    return id;
  }

  public String getLabel() {
    return label;
  }

  public void setLabel(String label) {
    this.label = label;
  }

}
